#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

#define PROC "/proc/nfs_file"

int main(int argc, char **argv)
{
	int fd;
	char buf[1024] = { 0 };
	
	//打开proc文件
	fd = open(PROC, O_RDWR);
	if(fd < 0){
		printf("open failed\n");
		return -1;
	}

	//向内核写数据
	int n = write(fd, "am user data", 12);
	printf("send msg: am user data\n");

	//从内核读数据
	n = read(fd, buf, 1024);
	//打印读取到的数据
	printf("recv msg: %s\n", buf);

	return 0;
}
